<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			// JS是弱类型语言 java是强类型语言 int num = 4; String str = "hello";
			// define:定义
			var num;// 只是声明没有赋值，现在的值是undefined
			console.log(num);// undefined
			// typeof() 用来判断变量的类型
			console.log(typeof(num))// undefined
			num = 3.14;
			console.log(num);// 3.14
			console.log(typeof(num))// number
			num = 'Hello JS';
			console.log(num);// Hello JS
			console.log(typeof(num))// string
			num = null;
			console.log(num);// null
			console.log(typeof(num))// object
			num = true;// boolean:只有两个值true和false
			console.log(num);// true
			console.log(typeof(num))// boolean
			
			// 数组
			var array = [2, 3, 4];
			// 数组的访问通过数组名加下标 array[0]
			console.log(array[0]);
			console.log(array[1]);
			console.log(array[2]);
			var array1 = new Array();// [] 这是一个空数组
			array1[0] = 12;
			array1[1] = 13;
			array1[2] = 14;
			console.log(array1[0]);
			console.log(array1[1]);
			console.log(array1[2]);
			// push  pop
			var array2 = new Array();// []
			array2.push(22);
			array2.push(23);
			array2.push(24);
			console.log(array2[0]);
			console.log(array2[1]);
			console.log(array2[2]);
		</script>
	</head>
	<body>
	</body>
</html>
